﻿package 
{
	import flash.text.TextFieldAutoSize;
	import flash.text.TextField;
	import flash.utils.setTimeout;
	import com.molamil.perilla.Perilla;

	import flash.display.Sprite;

	public class Main extends Sprite {
		private var tf : TextField;

		public function Main()
		{
			// Launch your application by right clicking within this class and select: Debug As > FDT SWF Application
			
			Perilla.init();
			Perilla.logFunction = function(str:String):void{
				tf.appendText(str + "\n");
			};
			Perilla.addMidiCallback("test", Perilla.control(1), perillaCallbackHandler, 0, 1);
			
			tf = new TextField();
			tf.autoSize = TextFieldAutoSize.LEFT;
			tf.text = "Log:\n";
			addChild(tf);
		}

		private function perillaCallbackHandler(value:Number) : void {
			tf.appendText("Value: " + value + "\n");
		}
	}
}
